<!-- include tpl=head -->
<script type="text/javascript">
var alisms_id = '{$rs.id}';
function update_tplcode(val)
{
	$("#content").val('');
	if(!val || val == 'undefined'){
		return true;
	}
	var url = get_url('gateway','extmanage','update=2&type=ajax&id='+alisms_id+'&manageid=send');
	url += "&tplcode="+val;
	$.phpok.json(url,function(data){
		if(data.status){
			$("#content").val(data.info);
		}
	});
	return true;
}
function sendsms()
{
	$("#submit2").attr('disabled',true);
	$('#sendsmssubmit').ajaxSubmit({
		'type':'post',
		'dataType':'json',
		'url':get_url('gateway','extmanage','update=1&type=ajax&id='+alisms_id+'&manageid=send'),
		'success':function(rs){
			if(rs.status){
				$.dialog.alert('短信发送成功',function(){$.phpok.reload()},'succeed');
			}else{
				$("#submit2").attr('disabled',false);
				$.dialog.alert(rs.info);
			}
		}
	});
	return false;
}
</script>
<form method="post" id="sendsmssubmit" onsubmit="return sendsms()">
<div class="table">
	<div class="title">
		手机号：
		<span class="note">提交接收人的手机号，仅支持一个手机号</span></span>
	</div>
	<div class="content">
		<input type="text" name="mobile" class="long" />
	</div>
</div>
<div class="table">
	<div class="title">
		短信模板：<span class="note">请选择要发送的短信模板，模板标签必须是您在阿里云上设置好的</span>
	</div>
	<div class="content">
		<select name="tplcode" onchange="update_tplcode(this.value)">
			<option value="">请选择…</option>
			<!-- loop from=$smslist key=$key value=$value id=$tmpid -->
			<option value="{$value.id}">模板：{$value.title}<!-- if $value.note -->/{$value.note}<!-- /if --></option>
			<!-- /loop -->
		</select>
	</div>
</div>
<div class="table">
	<div class="title">
		变量设置：
		<span class="note">请根据实际情况设置模板变量对应的内容</span></span>
	</div>
	<div class="content">
		<textarea name="content" id="content" class="long" style="height:180px;"></textarea>
	</div>
</div>

<div class="table">
	<div class="content">
		<br />
		<input type="submit" value="发短信" class="submit2" id="submit2" />
	</div>
</div>
</form>


<!-- include tpl=foot_open -->